package com.zxy.zxyrpc.serializer;

import java.io.IOException;

/**
 * 自定义SPI序列化器接口
 *
 * @author zxy
 * @since 2025/5/11
 **/
public interface Serializer {
    /**
     * 序列化
     * */
    <T> byte[] serialize(T object) throws IOException;

    /**
     * 反序列化
     * */
    <T> T deserialize(byte[] bytes, Class<T> type) throws IOException;
}
